from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()


class Person(db.Model):
    __tablename__ = 'person'
    sqlite_autoincrement = True
    id = db.Column('id', db.Integer, primary_key=True)
    name = db.Column('name', db.Text)
    phone = db.Column('phone', db.Text)
    email = db.Column('email', db.Text)

    def to_dict(self):
        return dict(
            id=self.id,
            name=self.name,
            phone=self.phone,
            email=self.email
        )
